package com.sc1905.crane.reading.service.impl;

import com.sc1905.crane.mapper.NBrowseMapper;
import com.sc1905.crane.pojo.NBrowse;
import com.sc1905.crane.reading.service.BrowseService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class BrowseServiceImpl implements BrowseService {
    @Resource
    NBrowseMapper nBrowseMapper;

    @Override
    public int insertBrowse(NBrowse nBrowse) {
        return nBrowseMapper.insertSelective(nBrowse);
    }

    @Override
    public NBrowse isRead(Integer userId, Integer novelId) {
        return nBrowseMapper.isRead(userId,novelId);
    }

    @Override
    public int updateBrowse(NBrowse nBrowse) {
        return nBrowseMapper.updateByPrimaryKeySelective(nBrowse);
    }


}
